﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Map/Pages/GPSTrackingWebsiteManager.Master" AutoEventWireup="true" CodeBehind="OpenStreetMap.aspx.cs" Inherits="GPSTrackingWebsiteManager.Pages.OpenStreetMap" %>

    
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    
    <style type="text/css">
      html, body, #basicMap {
          width: 100%;
          height: 100%;
          margin: 0;
      }
    </style>
    <script src="../../Javascript/OpenLayers.js"></script>
    <script src="../../Javascript/OpenStreetMapManagerV2.js"></script>

    <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
        <script type="text/javascript">
        function init() {
            map = new OpenLayers.Map("basicMap");
            var mapnik = new OpenLayers.Layer.OSM();
            var fromProjection = new OpenLayers.Projection("EPSG:4326");   // Transform from WGS 1984
            var toProjection = new OpenLayers.Projection("EPSG:900913"); // to Spherical Mercator Projection
            var position = new OpenLayers.LonLat(13.41, 52.52).transform(fromProjection, toProjection);
            var zoom = 15;

            map.addLayer(mapnik);
            map.setCenter(position, zoom);

            var lat = 47.35387;
            var lon = 8.43609;
            var zoom = 18;

            var fromProjection = new OpenLayers.Projection("EPSG:4326");   // Transform from WGS 1984
            var toProjection = new OpenLayers.Projection("EPSG:900913"); // to Spherical Mercator Projection
            var position = new OpenLayers.LonLat(lon, lat).transform(fromProjection, toProjection);

            //map = new OpenLayers.Map("Map");
            //var mapnik         = new OpenLayers.Layer.OSM();
            //map.addLayer(mapnik);

            var markers = new OpenLayers.Layer.Markers("Markers");
            map.addLayer(markers);
            markers.addMarker(new OpenLayers.Marker(position));

            map.setCenter(position, zoom);
        }
            </script>
    </telerik:RadScriptBlock>
    
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
     <body onload="initialize();">
        <div id="basicMap"></div>
      </body>
</asp:Content>
